var apply = exports.apply = function(object, config, defaults) {
    if (defaults) {
        apply(object, defaults);
    }

    if (object && config && typeof config === 'object') {

        for (var i in config) {
            object[i] = config[i];
        }
    }

    return object;
};

exports.applyIf = function(object, config) {
    var property;

    if (object) {
        for (property in config) {
            if (object[property] === undefined) {
                object[property] = config[property];
            }
        }
    }

    return object;
}